package com.alipay.sofa.award.endpoint.facade;

import com.alipay.sofa.award.common.dal.dataobject.ActivityTime;
import com.alipay.sofa.award.endpoint.constants.RestConstants;
import com.alipay.sofa.award.endpoint.constants.URLConstants;
import com.alipay.sofa.award.endpoint.exception.CommonException;
import com.alipay.sofa.award.endpoint.response.RestSampleFacadeResp;

import javax.ws.rs.*;
import java.util.Map;

/**
 * ActivityTimeRestFacade
 *
 * @author yangguanchao
 * @since 2018/08/27
 */
@Path(URLConstants.REST_API_PEFFIX + "/activity/time")
@Consumes(RestConstants.DEFAULT_CONTENT_TYPE)
@Produces(RestConstants.DEFAULT_CONTENT_TYPE)
public interface ActivityTimeRestFacade {

    /**
     * query
     * <p>
     * http://localhost:8341/webapi/activity/time
     *
     * @return ActivityTime
     */
    @GET
    @Path("/")
    RestSampleFacadeResp<Map<String, Object>> activityTime() throws Exception;

    /**
     * add
     *
     * you can use postman to mock the post request
     * <p/>
     * http://localhost:8341/webapi/activity/time
     * <p/>
     * post method add a user whose information is in the http request
     * @param activityTime activityTime
     * @return added count
     */
    @POST
    @Path("/")
    RestSampleFacadeResp<Integer> addActivityTime(ActivityTime activityTime) throws CommonException;

    /**
     * delete
     *
     * @param activityTime activity time
     * @return deleted count
     */
    @DELETE
    @Path("/")
    RestSampleFacadeResp<Integer> deleteActivityTime(@QueryParam("activityTime") String activityTime)
                                                                                                     throws CommonException;

    /***
     * update
     *
     * @param activityTime activityTime
     * @return updated count
     */
    @PUT
    @Path("/")
    RestSampleFacadeResp<Integer> updateUser(ActivityTime activityTime) throws CommonException;
}
